////////////////////////////////////////////////////////////////////////////////
// Copyright 2010 Michael Schmalle - Teoti Graphix, LLC
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0 
// 
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and 
// limitations under the License
// 
// Author: Michael Schmalle, Principal Architect
// mschmalle at teotigraphix dot com
////////////////////////////////////////////////////////////////////////////////
package fxplugins.utility
{

[DefaultProperty("instance")]

/**
 * The <code>Utility</code> class is used in declarative MXML definitions
 * of utilities in the <code>IUtilityMap</code>.
 * 
 * <p>Using the <code>instance</code> property in MXML.</p>
 * 
 * <listing version="3.0">
 * &lt;utility:UtilityMap 
 *     xmlns:managers="com.acme.project.managers.utilities.*"
 *     xmlns:utility="fxplugins.utility.*"&gt;
 * 	
 *     &lt;utility:Utility id="splashManager"
 *         type="com.acme.project.managers.ISplashManager"&gt;
 * 	    
 *         &lt;managers:SplashManager/&gt;
 * 	    
 *     &lt;/utility:Utility>
 * 
 * &lt;/utility:UtilityMap&gt;
 * </listing>
 * 
 * <p>Using the <code>provider</code> property in MXML.</p>
 * 
 * <listing version="3.0">
 * &lt;utility:UtilityMap 
 *     xmlns:utility="fxplugins.utility.*"&gt;
 * 	
 *     &lt;utility:Utility id="splashManager"
 *         type="com.acme.project.managers.ISplashManager"
 *         provider="com.acme.project.managers.ISplashManagerProvider"&gt;
 * 	    
 *     &lt;/utility:Utility>
 * 
 * &lt;/utility:UtilityMap&gt;
 * </listing>
 * 
 * <p>Using the <code>generator</code> property in MXML.</p>
 * 
 * <listing version="3.0">
 * &lt;utility:UtilityMap 
 *     xmlns:utility="fxplugins.utility.*"&gt;
 * 	
 *     &lt;utility:Utility id="splashManager"
 *         type="org.example.acme.services.ISplashManager"
 *         generator="org.example.acme.services.SplashManager"&gt;
 * 	    
 *     &lt;/utility:Utility>
 * 
 * &lt;/utility:UtilityMap&gt;
 * </listing>
 * 
 * @author Michael Schmalle
 * @copyright Teoti Graphix, LLC
 * @productversion 1.0
 */
public final class Utility
{
	//--------------------------------------------------------------------------
	//
	//  Public :: Variables
	//
	//--------------------------------------------------------------------------
	
	//----------------------------------
	//  type
	//----------------------------------
	
	/**
	 * The <code>Class</code> API used to register this service using either the
	 * <code>provider</code>, <code>generator</code> or <code>instance</code>
	 * properties to provide the actual plugin service instance.
	 */
	public var type:Class;
	
	//----------------------------------
	//  type
	//----------------------------------
	
	/**
	 * An <code>IPluginProvider</code> implementation that will return an instance
	 * of the <code>type</code>.
	 */
	public var provider:Class;
	
	//----------------------------------
	//  type
	//----------------------------------
	
	/**
	 * An <code>Class</code> reference that will be created during the 
	 * <code>serviceAdd</code> event of the plugin service map's initialization.
	 */
	public var generator:Class;
	
	//----------------------------------
	//  type
	//----------------------------------
	
	/**
	 * An instance already instantiated that implements to correct plugin 
	 * service <code>type</code>.
	 */
	public var instance:Object;
	
	//--------------------------------------------------------------------------
	//
	//  Constructor
	//
	//--------------------------------------------------------------------------
	
	/**
	 * Creates a new instance of a plugin service proxy.
	 * 
	 * <p>Note, this constructor usually is private when implemented in MXML,
	 * but can be used in straight actionscript code.</p>
	 */
	public function Utility()
	{
	}
}
}